package com.neuedu.demo3;

public class Homework04 {
    public static void main(String[] args) {
        int peach = 1;//第10天剩的桃子

        for (int i = 0; i < 9; i++) {
            peach = (peach + 1) * 2;//猴子一共吃了9天桃子,从第9天开始计算前一天的桃子
        }

        System.out.println("第一天摘了" + peach + "个桃子");
        //对桃子的数量进行验证
        int count = 0;
        while (peach != 1) {
            peach = peach - peach / 2 - 1;
            count++;
        }

        System.out.println(count);
    }
}
